<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8"/>
    <title>修改</title>
    <link href="__STATIC__/component/pear/css/pear.css" rel="stylesheet"/>
    {include file='public/head.html'}
</head>
<body class="pear-container">

<div class="layui-card">
    <div class="layui-card-body">
        <div class="layui-tab layui-tab-brief">
            <ul class="layui-tab-title">
                <li><a href="javascript:history.back(-1);">配置管理</a></li>
                <li class="layui-this">修改配置</li>
            </ul>
        </div>
        <form class="layui-form" action="{:url('edit')}" method="post">
            <input type="hidden" name="id" value="{$vo.id}"/>
            <input type="hidden" name="back_url" value="__HISTORY__">
            <div class="layui-form-item">
                <label class="layui-form-label layui-form-item-required">配置分组</label>
                <div class="layui-input-inline w30-100">
                    {:form_select('group_id', widget('config_group')->get(), $vo['group_id'])}
                </div>
                <div class="layui-form-mid"><i class="layui-icon layui-icon-about layui-font-blue"></i> 配置分组</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label layui-form-item-required">配置标题</label>
                <div class="layui-input-inline w30-100">
                    <input type="text" name="field_title" lay-verify="required" value="{$vo.field_title}" placeholder="标题(中文)" class="layui-input" />
                </div>
                <div class="layui-form-mid"><i class="layui-icon layui-icon-about layui-font-blue"></i> 配置标题</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label layui-form-item-required">配置键名</label>
                <div class="layui-input-inline w30-100">
                    <input type="text" name="field_name" lay-verify="required" value="{$vo.field_name}" placeholder="键名(英文)" class="layui-input" />
                </div>
                <div class="layui-form-mid"><i class="layui-icon layui-icon-about layui-font-blue"></i> 配置键名</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">配置键值</label>
                <div class="layui-input-inline w30-100">
                    <textarea name="field_value" placeholder="配置值" class="layui-textarea">{$vo.field_value}</textarea>
                </div>
                <div class="layui-form-mid"><i class="layui-icon layui-icon-about layui-font-blue"></i> 配置键值</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">配置说明</label>
                <div class="layui-input-inline w30-100">
                    <input type="text" name="field_comment" value="{$vo.field_comment}" placeholder="默认：配置标题" class="layui-input" />
                </div>
                <div class="layui-form-mid"><i class="layui-icon layui-icon-about layui-font-blue"></i> 配置说明</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">表单类型</label>
                <div class="layui-input-inline w30-100">
                    {:form_select('form_type', config_get('sys.form_type', 'text=文本框', true), $vo['form_type'])}
                </div>
                <div class="layui-form-mid"><i class="layui-icon layui-icon-about layui-font-blue"></i> 表单类型</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">输入提示</label>
                <div class="layui-input-inline w30-100">
                    <input type="text" name="form_tips" value="{$vo.form_tips}" placeholder="placeholder属性 默认：配置标题" class="layui-input" />
                </div>
                <div class="layui-form-mid"><i class="layui-icon layui-icon-about layui-font-blue"></i> 开关：开启|关闭</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">前端验证</label>
                <div class="layui-input-inline w30-100">
                    {:form_select('lay_verify', config_get('sys.lay_verify', 'none=无'), $vo['lay_verify'])}
                </div>
                <div class="layui-form-mid"><i class="layui-icon layui-icon-about layui-font-blue"></i>layui的lay-verify属性</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">表单属性</label>
                <div class="layui-input-inline w30-100">
                    <textarea name="form_attr" id="editor-form_attr" placeholder="属性名=属性值|属性名=属性值(如有=和|符号可用[eq]和[or]代替)" class="layui-textarea">{$vo.form_attr}</textarea>
                </div>
                <div class="layui-form-mid" style="padding: 0!important;">
                    日期区间：class=layui-input datetime|data-date-range=-|data-date-type=date<br>
                    省市地区：data-toggle=city-picker <br>
                    下拉多选：xm-select=[键名]|xm-select-skin=normal<br>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">选项设置</label>
                <div class="layui-input-inline w30-100">
                    <textarea name="form_options" id="editor-form_options" placeholder="选项值=选项名|选项值=选项名" class="layui-textarea">{$vo.form_options}</textarea>
                </div>
                <div class="layui-form-mid">
                    select和radio的选项<br>
                    如有=和|符号可用[eq]和[or]代替
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">必填标记</label>
                <div class="layui-input-inline w30-100">
                    <input type="hidden" name="form_required" value="0" />
                    <input type="checkbox" name="form_required" value="1" lay-skin="switch" lay-text="是|否"{if $vo['form_required']:} checked="checked"{/if}/>
                </div>
                <div class="layui-form-mid"><i class="layui-icon layui-icon-about layui-font-blue"></i> 标题前的星号是否显示</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">容器样式</label>
                <div class="layui-input-inline w30-100">
                    <input type="text" name="input_style" value="{$vo.input_style}" placeholder="默认：layui-input-block" class="layui-input" />
                </div>
                <div class="layui-form-mid"><i class="layui-icon layui-icon-about layui-font-blue"></i> layui-input-group</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">禁删</label>
                <div class="layui-input-inline w30-100">
                    <input type="hidden" name="is_sys" value="0">
                    <input type="checkbox" name="is_sys" value="1" lay-skin="switch" lay-text="是|否"{if $vo['is_sys']:} checked="checked"{/if}>
                </div>
                <div class="layui-form-mid"><i class="layui-icon layui-icon-about layui-font-blue"></i> 禁删防止误删</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">排序</label>
                <div class="layui-input-inline w30-100">
                    <input type="number" name="sort" value="{$vo.sort}" placeholder="请输入排序值" class="layui-input" min="0" step="10" lay-affix="number" />
                </div>
                <div class="layui-form-mid"><i class="layui-icon layui-icon-about layui-font-blue"></i> 越小排序越靠前</div>
            </div>

            <div class="layui-form-item">
                <button class="layui-btn" lay-submit="" lay-filter="save">修改</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </form>
    </div>
</div>

<script src="__STATIC__/component/layui/layui.js"></script>
<script src="__STATIC__/component/pear/pear.js"></script>
<script>
    layui.use(['aphp', 'form', 'aphpForm', 'layer'], function () {
        var aphp = layui.aphp;
        var form = layui.form;
        var aphpForm = layui.aphpForm;

        form.on('submit(save)', function (data) {
            aphp.request.postForm(data, 2);
            return false;
        });
    })
</script>
</body>
</html>